package cn.ekgc.smph.service;

import cn.ekgc.smph.dao.EmpDao;
import cn.ekgc.smph.entity.Emp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class EmpServiceImpl implements EmpService {
    @Autowired
    private EmpDao empDao;

    @Transactional
    @Override
    public void saveOrUpdate(Emp emp) {
        empDao.saveOrUpdate(emp);
    }

    @Transactional
    @Override
    public void delete(String id) {
      empDao.delete(id);
    }

    @Override
    public List<Emp> list() {
        return empDao.list();
    }
}
